<?php

namespace app\yunda\validate;
use think\Validate;

/**
 * 网点
 * @package app\yunda\validate
 */
class Map extends Validate
{
    //定义验证规则
    protected $rule = [
        'wd_name|网点名称' => 'require|max:100',
        'wd_address|网点地址' => 'require',
        'fw_time|服务时间' => 'require|regex:^\d{1,2}[\:]\d{2}[\-]\d{1,2}[\:]\d{2}$',
        'xd_phone|下单电话' => 'require|regex:^1[3,5,6,7,8]{1}\d{9}$',
        'ts_phone|投诉电话' => 'require|regex:^1[3,5,6,7,8]{1}\d{9}$',
        'cx_phone|查询电话' => 'require|regex:^1[3,5,6,7,8]{1}\d{9}$',
        'ps_area|配送范围' => 'require',
        //'yw_else|增值时间' => 'require',
    ];

    //定义验证提示
    protected $message = [
        'wd_name.max' => '网点名称最多100个字符',
        'fw_time.regex' => '服务时间格式不对',
        'xd_phone.regex' => '下单电话不正确',
        'ts_phone.regex' => '投诉电话不正确',
        'cx_phone.regex' => '查询电话不正确',
    ];
}
